package com.bw.home.api


import com.bw.common.api.BaseApiServer
import com.bw.common.entity.BaseResponse
import com.bw.common.entity.CommendEntity
import com.bw.common.entity.SimpleVideoEntity
import com.bw.home.entity.SimpleTypeEntity
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface HomeApiServer: BaseApiServer {
    @GET("/videotype/getSimpleType")
    suspend fun getSimpleType(): BaseResponse<List<SimpleTypeEntity>>

    @GET("/videosimple/getRecommendSimpleVideo")
    suspend fun getRecommendSimpleVideo(
        @Query("page") page: Int,
        @Query("pagesize") pageSize: Int
    ): BaseResponse<List<SimpleVideoEntity>>

    @GET("/videosimple/getSimpleVideoByChannelId")
    suspend fun getSimpleVideoByChannelId(
        @Query("channelId") channelId: String,
        @Query("page") page: Int,
        @Query("pagesize") pageSize: Int
    ): BaseResponse<List<SimpleVideoEntity>>

    @GET("/comment/getCommentByUserId")
    suspend fun getVideoCommends(
        @Query("datatype") dataType: Int,
        @Query("itemid") itemId: String
    ): BaseResponse<List<CommendEntity>>

    @POST("/comment/publishComment")
    suspend fun publishVideoComment(@Body requestBody: RequestBody): BaseResponse<List<CommendEntity>>
}